<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let json = {a: 12, b: 5};

        // let str = 'http://baidu.com?data=' + encodeURIcomponent(JSON.stringify(json));

        // alert(str);
    </script>

    <script>
        let str = '{"a":12, "b": 5, "c": "abc"}';
        let json = JSON.parse(str);

        console.log(json);
    </script>
</body>
</html>